#ifndef TEX_H
#define TEX_H
#include "Includes.h"
#include "Vector.h"

class Texture
{
public:
	Texture(const char* fileName, int keyR=255, int keyG=0, int keyB=255);
	Texture(const char* fileName, const char* rawFile);
	void Destroy();
	~Texture();

	int Width;
	int Height;

	GLuint operator()();
	GLuint GetId() {return TexId;}

private:
	GLuint TexId;
};

typedef unsigned char BYTE;
#define BMPError char
#define BMPNOTABITMAP 'b'
#define BMPNOOPEN 'o'
#define BMPFILEERROR 'f'
#define BMPBADINT 'i'
#define BMPNOERROR '\0'
#define BMPUNKNOWNFORMAT 'u'
class BMPClass
{
public:
	BMPClass();
	~BMPClass();
	BYTE& pixel(int x,int y,int c);
	void allocateMem();
	int width,height;
	BYTE* bytes;			//OpenGL formatted pixels

	static BMPError BMPLoad(std::string fname,BMPClass& bmp);
	static std::string TranslateBMPError(BMPError err);
};

#endif
